package com.bawei.bydayzg_two.adapter

import com.bawei.base.bean.CartGoreyChild
import com.bawei.bydayzg_two.R
import com.bawei.bydayzg_two.Utils.GildUtils
import com.blankj.utilcode.util.ToastUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class ChildAdapter:BaseQuickAdapter<CartGoreyChild,BaseViewHolder>(R.layout.item_cate_two_child) {
    override fun convert(holder: BaseViewHolder, item: CartGoreyChild) {
        holder.setText(R.id.child_tv,item.name)
        GildUtils.loadImg(context,item.extra,holder.getView(R.id.child_iv))

        //点击添加点击事件
        holder.itemView.setOnClickListener {
            ToastUtils.showLong("点击了${item.name}编号为：${item.id}")
        }
    }
}